3rdstagefandomcom-20200214-history
On Blockchain
__TOC__ General * Blockchain ** a distributed database that maintains a continuously-growing list of records called blocks. * A Next-Generation Smart Contract and Decentralized Application Platform * Private blockchain * On Public and Private Blockchains (August 7th, 2015) * What are the best open source projects to study blockchain technology in terms of simplicity? * What is the best programming language to learn if you want to work on the blockchain? * Bitcoin mining the hard way: the algorithms, protocols, and bytes * A 101 Noob Intro to Programming Smart Contracts on Ethereum * [https://www.linkedin.com/pulse/blockchain-database-adi-ben-ari Blockchain as a Database] (July 31, 2015) Smart Contract * Smart Contract (on Wikipedia) Bitcoin * Bitcoin Developer Guide * Mastering Bitcoin (O'reilly, Andreas M. Antonopoulos) * Bitcoin Wiki * Proof of Work ** Proof of work ** The Proof-of-Work Concept (June 24, 2013) Solidity References * Solidity (on Wikipedia) ** an object-oriented programming language for writing smart contracts. * Solidity official documentation * Solidity Tutorials * Learn Solidity in Y minutes Readings * Solidity in Depth ** Units and Globally Available Variables * Solidity sources (on GitHub) * Solidity browser based compiler * Javascript bindings for the solidity compiler ** compile function * Ethereum Contract ABI Ethereum * Ethereum Wiki * A Next-Generation Smart Contract and Decentralized Application Platform * Ethereum Design Rationale * Ethereum documentation * Ethereum Natural Specification Format * Clients ** GETH & ETH Command line tools for the Ethereum Network * Testnet ** Running Ethereum testnet using Geth ** Ethereum testnets Go Ethereum * https://github.com/ethereum/go-ethereum * Desc. : Official golang implementation of the Ethereum protocol * License * Readings ** Go Ethereum Wiki ** geth Command Line Options ethereumj Mist Browser Truffle * https://github.com/trufflesuite/truffle * Desc. : a development environment, testing framework and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier * License : MIT * Readings ** Truffle official documentation Zeppelin Solidity * https://github.com/OpenZeppelin/zeppelin-solidity * Desc. : a library for writing secure Smart Contracts on Ethereum. * License : MIT * Readings ** Zeppelin-Solidity documentation web3j * https://github.com/web3j/web3j * Desc. : a lightweight, highly modular, reactive, type safe Java and Android library for working with Smart Contracts and integrating with clients (nodes) on the Ethereum network * License : Apache License 2.0 * Written in : Java * Readings ** web3j official documentation Hyperledger * Hyperledger Projects ** Hyperledger Cello ** Hyperledger Fabric ** Hyperledger Iroha ** Hyperledger Sawtooth Lake Hyperledger Fabric * https://github.com/hyperledger/fabric * Desc. : an implementation of blockchain technology, leveraging familiar and proven technologies. * License : Apache License Version 2.0 * Written in : Go * Docker repository : https://hub.docker.com/u/hyperledger/ * Docker images : https://github.com/hyperledger/fabric/tree/master/images * Projects ** hyperledger/fabric ** hyperledger/fabric-docs ** hyperledger/fabric-samples ** hyperledger/fabric-chaincode-java ** hyperledger/fabric-chaincode-node ** hyperledger/fabric-chaintool ** hyperledger/fabric-sdk-rest ** hyperledger/fabric-sdk-node ** hyperledger/fabric-sdk-java ** hyperledger/fabric-sdk-py ** hyperledger/fabric-sdk-go Readings * References ** Official documentation ** Transaction Flow ** Read-Write set semantics ** Bringing up a Kafka-based Ordering Service ** CLI ** Specification ** REST API * Concepts ** Channels *** Channel = Organizations + Ordering Service + Anchor Peers + Chaincodes + Ledger *** At least one anchor peer per organization * Setup ** Getting Setup ** Setting Up a Network ** Multichannel Setup ** Install and Instantiate ** v1.0.0-alpha2 *** sample configtx.yaml *** sample core.yaml *** sample orderer.yaml *** Getting Started ** v1.0.0-beta *** sample crypto-config.yaml * Ordering ** A Kafka-based Ordering Service for Fabric * Ledger ** Hyperledger Fabric V1.0: Block Structure (Part 1) * Chaincode ** What is chaincode? ** Chaincode API ** Java chaincode ** [http://hyperledger-fabric.readthedocs.io/en/latest/Setup/Chaincode-setup.html Writing, Building, and Running Chaincode in a Development Environment] ** Chaincode examples * SDK ** Hyperledger Fabric SDK Design Specification v1.0 * misc ** Hyperledger Fabric Approaches v1.0 with Better Scalability and Security ** Logging Control ** Hyperledger Fabric V1.0: Block Structure (Part 1) Examples * CLI based End-to-End Flow ** 1 Orderer, 3 Peer, 1 CLI ** configtx.yaml ** docker-compose.yaml ** docker-compose-no-tls.yaml ** script.sh : called by yaml file * Fabric official samples ** Build Your First Network (BYFN) * github.com/ksachdeva/hyperledger-fabric-example ** ksachdeva.github.io Demos * ITPeople Blockchain - Art Auction Demo * IBM Blockchain - Marbles Demo Sources * fabric/core/ledger/util/couchdb/couchdb.go ** 1.0.0-alpha *** handleRequest(method, connectURL string, data io.Reader, rev string, multipartBoundary string) (*http.Response, *DBReturn, error) ** 1.0.0-beta *** handleRequest(method, connectURL string, data [byte, rev string, multipartBoundary string, maxRetries int, keepConnectionOpen bool) (*http.Response, *DBReturn, error)] * fabric/core/chaincode/shim/interfaces.go ** 1.0.0-alpha *** PutState(key string, value [byte) error] *** GetState(key string) ([byte, error)] * fabric/core/ledger/ledgerconfig/ledger_config.go ** 1.0.1 Issues * FAB-6092 : Gossip error: PKIID wasn't found (10/Sep/17) * FAB-6421 : Performance and scale improvements for 1.1 (03/Oct/17) Docker Images fabric-peer Config which is printed by "docker inspect --format=' ' ..." is "Config": { "Hostname": "e7eddde82bec", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PEER_CFG_PATH=/etc/hyperledger/fabric", "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig" ], "Cmd": [ "peer", "node", "start" ], "ArgsEscaped": true, "Image": "sha256:793719e9dd193f580f32c5984ac47a8c0f986819e4795c039703b26bb6ad15ce", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": [], "Labels": { "org.hyperledger.fabric.base.version": "0.3.0", "org.hyperledger.fabric.version": "1.0.0-alpha" } }, Fabric CA * Fabric CA User’s Guide * Fabric CA Server REST API Fabric SDK for Node.js * Sources : ** https://github.com/hyperledger/fabric-sdk-node ** https://github.com/hyperledger/fabric-sdk-node/tree/master/fabric-client ** https://github.com/hyperledger/fabric-sdk-node/tree/master/fabric-ca-client * Features ** create channels ** ask peer nodes to join the channel ** install chaincodes in peers ** instantiate chaincodes in a channel ** invoke transactions by calling the chaincode ** query the ledger for transactions or blocks * Readings ** Official documentation ** [https://fabric-sdk-node.github.io/ Application developer documentations] * Examples ** Balance transfer example *** https://github.com/hyperledger/fabric-sdk-node/tree/master/examples/balance-transfer Network Setup Setup and launch Fabric CA server # Install Go 1.7+ # Set GOPATH # Install libtool and libtdhl-dev #* # sudo apt install libtool libltdl-dev # Install fabric-ca-server and fabric-ca-client Performance Tuning * JBOD or RAID * LVM (Logical Volume Manager) * Filesystem Journaling ** Disabling Journaling in Ubuntu 14.04? * ulimit ** Set ulimit parameters on ubuntu (2009/06/04) * noatime ** Reducing Disk IO By Mounting Partitions With noatime ** Is it worth to tune Ext4 with noatime? (Aug 12 '10) ** RHEL 6 Filesystem Mount Options * vm.swappiness ** Swappiness ** RHEL 6 Tuning Virtual Memory *** A low swappiness value is recommended for database workloads. ** Swap Space and Kernel Swappiness ** How do I configure swappiness? (Ask Ubuntu) * Disk I/O Scheduler ** Noop for SSD ** Linux I/O Scheduler Comparison On The Linux 3.4 Desktop(11 May 2012) ** Selecting a Linux I/O Scheduler ** Linux Change The I/O Scheduler For A Hard Disk ** SSD benchmark of I/O schedulers (April 28th, 2010) * Docker OverlayFS storage driver ** Use the OverlayFS storage driver * CouchDB ** Linux tuning for better CouchDB performance * misc ** Tuning Linux for Database performance Companions PTE * https://github.com/dongmingh/v1performance * Desc. : Performance Traffic Engine Eris * https://monax.io/ * Desc. : an open platform for developers and devops to build, ship, and run blockchain-based applications for business ecosystems. * License : https://monax.io/library/#licensing * Sources : https://github.com/eris-ltd * References ** Eris official documentation ** Eris Getting Started *** Building Your First Blockchain App with Eris (August 24, 2016) ** Eris Command Line Interface ** [https://monax.io/docs/documentation/db/latest/specifications/api/ Eris DB Web APIs] ** Jobs Specification ** Variables Specification * Readings ** Using Docker Machine With Eris ** On Eris and Tendermint: Application and Consensus (2016/03/02) ** Cannot deploy smart contract with Eris / Monax *** Could not perform pkg action service: Could not perform pkg action: Docker: {"mssage":"Cannot link to a non running container: /simplechain ** The Blockchain Explained to Web Developers, Part 1: The Theory (2016/04/28) ** The Blockchain Explained to Web Developers, Part 2: In Practice (2016/05/20) ** The Blockchain Explained to Web Developers, Part 3: The Truth (2016/06/14) ** Eris and Ethereum - Decentralized computing on a blockchain (May 20, 2015) Tendermint * https://tendermint.com/ * Desc. : Byzantine fault-tolerant replicated state machines in any programming language * License : ?